﻿@{
    Layout = "";
}

<script>
    // 如果 TempData["Message"] 有内容，则显示一个 alert 对话框
    @if (TempData["Message"] != null)
    {
        <text>
            alert("@Html.Raw(TempData["Message"])");
        </text>
    }
    document.addEventListener("DOMContentLoaded", function () {
        var passwordInput = document.getElementById("exampleInputPassword");
        var confirmPasswordInput = document.getElementById("exampleRepeatPassword");
        var form = document.querySelector("form");

        form.addEventListener("submit", function (event) {
            if (passwordInput.value !== confirmPasswordInput.value) {
                event.preventDefault(); // 阻止表单提交
                alert("密码和确认密码不匹配，请重新输入。");
            }
        });
    });
</script>

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>注册</title>

    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
          rel="stylesheet">
    <link href="~/css/sb-admin-2.min.css" rel="stylesheet"/>

</head>

<body class="bg-gradient-primary">

    <div class="container">

        <div class="card o-hidden border-0 shadow-lg my-5">
            <div class="card-body p-0">
                <div class="row">
                    <div class="col-lg-5 d-none d-lg-block bg-register-image"></div>
                    <div class="col-lg-7">
                        <div class="p-5">
                            <div class="text-center">
                                <h1 class="h4 text-gray-900 mb-4">创建一个新的账号!</h1>
                            </div>

                             <form class="user" asp-controller="UserAndRole" asp-action="EnrollSumbit" method="post">
                                <div class="form-group row">
                                    <div class="col-sm-6 mb-3 mb-sm-0">
                                        <input type="text" class="form-control form-control-user" id="exampleFirstName" name="user_name" maxlength="50" 
                                               placeholder="我该怎么称呼你呢?" required>
                                    </div>

                                </div>
                                <div class="form-group">
                                    <input type="email" class="form-control form-control-user" id="exampleInputEmail" name="user_account" maxlength="50"
                                           placeholder="邮箱地址" required>
                                </div>
                                <div class="form-group">
                                    <input type="number" class="form-control form-control-user" id="exampleInputPhone" name="phone" maxlength="30"
                                           placeholder="电话号码" required>
                                </div>

                                <div class="form-group row">
                                    <div class="col-sm-6 mb-3 mb-sm-0">
                                        <input type="password" class="form-control form-control-user" name="user_password" maxlength="50"
                                               id="exampleInputPassword" placeholder="密码" required>
                                    </div>
                                    <div class="col-sm-6">
                                        <input type="password" class="form-control form-control-user" maxlength="50"
                                               id="exampleRepeatPassword" placeholder="确认密码" required>
                                    </div>
                                </div>
                                <input type="submit" class="btn btn-primary btn-user btn-block" value="注册"/>
                            </form>

                            <!--下面额外的一些提示-->
                            <hr>
                            <div class="text-center">
                                <a class="small" asp-controller="UserAndRole" asp-action="ForgotKey">忘记了密码？</a>
                            </div>
                            <div class="text-center">
                                <a class="small" asp-controller="UserAndRole" asp-action="Login">已经有一个账号了!登录</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>
    <script src="js/sb-admin-2.min.js"></script>

</body>

</html>